<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  {% block title %}
  <title>个人博客</title>
  {% endblock %}
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="/static/images/bitbug_favicon.ico" type="image/x-icon" />
  <link href="/static/css/base.css" rel="stylesheet">
  <link href="/static/css/index.css" rel="stylesheet">
  <link href="/static/css/m.css" rel="stylesheet">
  <script src="/static/js/jquery.min.js" type="text/javascript"></script>
  <script src="/static/js/jquery.easyfader.min.js"></script>
  <script src="/static/js/scrollReveal.js"></script>
  <script src="/static/js/common.js"></script>
  {% block style %}
  {% endblock %}
</head>

<body>
  <header id="header">
    <!--menu begin-->
    <div class="menu">
      <nav class="nav" id="topnav">
        <h1 class="logo"><a href="/">个人博客</a></h1>
        <li><a href="/">博客首页</a> </li>
        <li><a href="/list">文章列表</a>
          <ul class="sub-nav">
            {% for category in params.categories %}
                <li><a href="/list?id={{category.id}}">{{category.cate_name}}</a></li> 
            {% endfor %}
          </ul>
        </li>
        <li><a href="/photo">我的相册</a>
        </li>
        <li><a href="/time">时间轴</a> </li>
        <li><a href="/gbook">评论</a> </li>
        <li><a href="/about">关于我</a> </li>
        <li><a href="/release">发表博客</a></li>
      </nav>
    </div>
    {% if params.user %}
        <a id="login" >欢迎:{{params.user.uname}}</a>
        <a href="/logout" id="register" target="_blank">退出</a>
    {% else %}
        <a href="/login" id="login" target="_blank">登录</a>
        <a href="/register" id="register" target="_blank">注册</a>
    {% endif %}
    <!--menu end-->           
  </header>

  {% block pagebg %}
  {% endblock %}

 
  <article>
    {% block banner %}
    <!--banner begin-->
    <div class="picsbox">
      <div class="banner">
        <div id="banner" class="fader">
            {% for topic in params.topics[0:3] %}
            <li class="slide">
                <a href="/info?id={{topic.id}}" target="_blank">
                    <img src="/static/{{topic.images}}">
                    <span class="imginfo">{{topic.title}}</span>
                </a>
            </li>
            {% endfor %}
          <div class="fader_controls">
            <div class="page prev" data-target="prev">&lsaquo;</div>
            <div class="page next" data-target="next">&rsaquo;</div>
            <ul class="pager_list">
            </ul>
          </div>
        </div>
      </div>
      <!--banner end-->
      <div class="toppic">
        {% for topic in params.topics[3:5] %}
        <li> 
            <a href="/info?id={{topic.id}}" target="_blank">
                <i><img src="/static/{{topic.images}}"></i>
                <h2>{{topic.title}}</h2>
                <span>{{topic.category.cate_name}}</span>
            </a> 
        </li>
        {% endfor %}
      </div>
    </div>
    <div class="blank"></div>
    <!--blogsbox begin-->
    {% endblock %}

    {% block main %}
    <div class="blogsbox">
      {% for topic in params.topics %}
      <div class="blogs" data-scroll-reveal="enter bottom over 1s">
        <h3 class="blogtitle"><a href="/info?id={{topic.id}}" target="_blank">{{topic.title}}</a></h3>
        {% if topic.images %}
        <span 
          {% if loop.index % 2 ==0 %}
            class="bigpic"
          {% else %}
            class="blogpic"
          {% endif %}
        >
          <a href="/info?id={{topic.id}}" title="">
            <img src="/static/{{topic.images}}" alt="">
          </a>
        </span>
        {% endif %}
        <p class="blogtext">{{topic.content|truncate(200)}}</p>
        <div class="bloginfo">
          <ul>
            <li class="author"><a href="/info?id={{topic.id}}">{{topic.user.uname}}</a></li>
            <li class="lmname"><a href="/info?id={{topic.id}}">{{topic.category.cate_name}}</a></li>
            <li class="timer">{{topic.pub_date}}</li>
            <li class="view"><span>{{topic.read_num}}</span>已阅读</li>
            <li class="like">{{topic.voke_users.count()}}</li>
            <!-- 当前博客id和当前用户的id 插入数据库 -->
          </ul>
        </div>
      </div>
      {% endfor %}
    </div>
    <!--blogsbox end-->
    <div class="sidebar">
      <div class="zhuanti">
        <h2 class="hometitle">特别推荐</h2>
        <ul>
          <li> <i><img src="/static/images/banner03.jpg"></i>
            <p>CentOS7下python开发环境配置 <span><a href="#">阅读</a></span> </p>
          </li>
          <li> <i><img src="/static/images/b04.jpg"></i>
            <p>Python基础概念_2_基础概念<span><a href="#">阅读</a></span></p>
          </li>
          <li> <i><img src="/static/images/b05.jpg"></i>
            <p>Python之if判断语句与while和for循环<span><a href="#">阅读</a></span></p>
          </li>
        </ul>
      </div>
      <div class="tuijian">
        <h2 class="hometitle">推荐文章</h2>
        <ul class="tjpic">
          <i><img src="/static/images/toppic01.jpg"></i>
          <p><a href="#">python中打开TXT文件报错</a></p>
        </ul>
        <ul class="sidenews">
          <li> <i><img src="/static/images/toppic01.jpg"></i>
            <p><a href="#">python学习网址以及笔记</a></p>
            <span>2018-05-13</span>
          </li>
          <li> <i><img src="/static/images/toppic02.jpg"></i>
            <p><a href="#">CentOS7下python开发环境配置</a></p>
            <span>2018-05-13</span>
          </li>
          <li> <i><img src="/static/images/v1.jpg"></i>
            <p><a href="#">python初步实现word2vec</a></p>
            <span>2018-05-13</span>
          </li>
          <li> <i><img src="/static/images/v2.jpg"></i>
            <p><a href="#">Python之if判断语句与while和for循环</a></p>
            <span>2018-05-13</span>
          </li>
        </ul>
      </div>
      <div class="tuijian">
        <h2 class="hometitle">点击排行</h2>
        <ul class="tjpic">
          <i><img src="/static/images/toppic01.jpg"></i>
          <p><a href="#">Python语言在人工智能(AI)中的优势</a></p>
        </ul>
        <ul class="sidenews">
          <li> <i><img src="/static/images/toppic01.jpg"></i>
            <p><a href="#">精通Python编程——Python深入浅出教程</a></p>
            <span>2018-05-13</span>
          </li>
          <li> <i><img src="/static/images/toppic02.jpg"></i>
            <p><a href="#">人生苦短 Python当歌</a></p>
            <span>2018-05-13</span>
          </li>
          <li> <i><img src="/static/images/v1.jpg"></i>
            <p><a href="#">Python学习笔记：虚拟环境和包</a></p>
            <span>2018-05-13</span>
          </li>
          <li> <i><img src="/static/images/v2.jpg"></i>
            <p><a href="#">python中打开TXT文件报错</a></p>
            <span>2018-05-13</span>
          </li>
        </ul>
      </div>
      <div class="cloud">
        <h2 class="hometitle">标签云</h2>
        <ul>
          <a href="#">陌上花开</a> <a href="#">校园生活</a> <a href="#">html5</a> <a href="#">SumSung</a> <a href="#">青春</a> <a
            href="#">温暖</a> <a href="#">阳光</a> <a href="#">三星</a><a href="#">索尼</a> <a href="#">华维荣耀</a> <a href="#">三星</a>
          <a href="#">索尼</a>
        </ul>
      </div>
      <div class="links">
        <h2 class="hometitle">友情链接</h2>
        <ul>
          <li><a href="#" target="_blank">达内</a></li>
          <li><a href="#" target="_blank">亿元级IT教育领军企业</a></li>
          <li><a href="#" target="_blank">人工智能改变世界</a></li>
        </ul>
      </div>
      <div class="guanzhu" id="follow-us">
        <h2 class="hometitle">关注我们 么哒！</h2>
        <ul>
          <li class="sina"><a href="#" target="_blank"><span>微信公众号</span>达内</a></li>
          <li class="tencent"><a href="#" target="_blank"><span>微信咨询</span>XXX</a></li>
          <li class="qq"><a href="#" target="_blank"><span>QQ号</span>XXXXXX</a></li>
          <li class="email"><a href="#" target="_blank"><span>邮箱帐号</span>tedu.cn</a></li>
          <li class="wxgzh"><a href="#" target="_blank"><span>咨询电话</span>xxxxxxxxxxx</a></li>
        </ul>
      </div>
    </div>
  </article>
  {% endblock %}
  
  <footer id="footer">
    <p>Design by <a href=# target="_blank">个人博客</a> <a href="#">备XXXXXXXXX号-1</a></p>
  </footer>
  <a href="#" class="cd-top">Top</a>
</body>

</html>